package codeRandomThoughts.Test6238统计构造好字符串的方案数;

public class Solution {
    public static int countGoodStrings(int low, int high, int zero, int one) {
        double[] dp = new double[high + 1];
        int mod = (int) (1e9 + 7);
        dp[0] = 1;

        for (int i = 1; i <= high; i++) {
            double tem1 = 0;
            double tem2 = 0;
            if (i >= zero) {
                tem1 = dp[i - zero];
            }
            if (i >= one) {
                tem2 = dp[i - one];
            }
            dp[i] = (tem1 + tem2) % mod;
        }

        int sum = 0;
        for (int i = low; i <= high; i++) {
            sum = (int) ((sum + dp[i]) % mod);
        }
        return sum;
    }

    public static void main(String[] args) {
        System.out.println(countGoodStrings(1, 100000, 1, 1));
    }
}
